package com.workmanager.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by dana on 2016/9/9.
 */
public class test {
    public static void main(String [] args){
        try {
            Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-08-29 22:22:00");
            Date date2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2016-08-29 22:22:10");
            if(date.getTime()>date2.getTime()){
                System.out.println(date2);
                System.out.println(date);
            }else{
                System.out.println(date);
                System.out.println(date2);
            }

        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
